@echo off
setlocal

:: Check if the parameter is provided
if "%~1"=="" (
    echo Usage: %~nx0 [service_name]
    exit /b 1
)

:: Set the service name variable
set service_name=%~1

:: Run the goctl api plugin command
echo goctl api plugin -plugin goctl-swagger="swagger -filename %service_name%.json" -api services/%service_name%/api/desc/%service_name%.api -dir services/%service_name%/api/desc
goctl api plugin -plugin goctl-swagger="swagger -filename %service_name%.json" -api services/%service_name%/api/desc/%service_name%.api -dir services/%service_name%/api/desc

endlocal
